const key = `${process.env.PROJECT_CODE}_token_41b596a3-d258-55e5-a647-9db1792fcdd4`;

/**
 * 获取 token => Authorization（接口访问权限）
 */
const getToken = () => {
  return localStorage.getItem(key)?.split('##')?.[0];
};

const getRawToken = () => {
  return localStorage.getItem(key);
};

/**
 * 设置 token
 */
const setToken = token => {
  localStorage.setItem(key, token);
};

/**
 * 移除 token
 */
const removeToken = () => {
  localStorage.removeItem(key);
};

export { getToken, getRawToken, setToken, removeToken };
